package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

/**
 * UserMapper
 *
 * @author liliudong
 * @version 1.0
 * @description
 * @date 2023/8/1 14:06
 */
@Mapper
public interface UserMapper {
    /**
     * 选择byopenid
     *
     * @param openid openid
     * @return {@link User}
     */
    User selectByOpenid(String openid);

    /**
     * 插入
     *
     * @param user 用户
     */
    void insert(User user);

    /**
     * 选择用户统计
     *
     * @param begin 开始
     * @param end   结束
     * @return {@link List}<{@link Map}<{@link String}, {@link Object}>>
     */
    List<Map<String, Object>> selectUserStatistics(LocalDate begin, LocalDate end);

    /**
     * 选择计数创建时间
     *
     * @param date 日期
     * @return {@link Integer}
     */
    Integer selectCountByCreateTime(String date);
}
